﻿using System.Collections.Generic;
using System.Linq;
using Microsoft.FxCop.Sdk;

namespace LINQtoFxCop.Core
{
  public class AssemblyNode : Node
  {
    private readonly ModuleNode _module;

    public AssemblyNode(ModuleNode module)
      : base(module.NodeType)
    {
      _module = module;
    }

    public IEnumerable<TypeNode> Types
    {
      get
      {
        return _module.Types.Where(type => !type.IsModuleType());
      }
    }

    public override int UniqueKey
    {
      get
      {
        return _module.UniqueKey;
      }
    }

    public override string ToString()
    {
      return _module.Name;
    }
  }
}
